<!DOCTYPE html>
<html lang="zh">
<head>
	<th:block th:include="include :: header('文件上传')" />
	<th:block th:include="include :: bootstrap-fileinput-css" />
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">

                    <div class="ibox-content">
                        <div class="form-group">
                            <label class="font-noraml">多文件上传</label>
	                        <div class="file-loading">
					            <input id="fileinput-demo-1" name="files" type="file" multiple>
					        </div>
                        </div>
                        <hr>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: bootstrap-fileinput-js" />
    <script type="text/javascript">

        var prefix = ctx + "dxfcomponent/cad"
    $(document).ready(function () {
        $("#fileinput-demo-1").fileinput({
            'theme': 'explorer-fas',
            'uploadUrl': '#',
            overwriteInitial: false,
            initialPreviewAsData: true,
            // initialPreview: [
            //     "/img/profile.jpg"
            // ]
        });
    });

    function submitHandler() {
        // if ($.validate.form()) {
        //     save(prefix + "/add", data);
        // }
        successCallback();
    }
    
    // function save (url, data, callback) {
    //     var config = {
    //         url: url,
    //         type: "post",
    //         dataType: "json",
    //         data: data,
    //         beforeSend: function () {
    //             $.modal.loading("正在处理中，请稍后...");
    //             $.modal.disable();
    //         },
    //         success: function(result) {
    //             if (typeof callback == "function") {
    //                 callback(result);
    //             }
    //             successCallback(result);
    //         }
    //     };
    //     $.ajax(config)
    // }

    function successCallback() {
        var parent = window.parent;

        $.modal.close();
        parent.$.table.refresh();

        $.modal.closeLoading();
        $.modal.enable();
    }
    </script>
</body>
</html>
